Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Level builder #29

Merged
merged 10 commits into from
Aug 17, 2024
Merged

Level builder #29

merged 10 commits into from
Aug 17, 2024

Conversation

NonSwag
Copy link
Member

@NonSwag NonSwag commented Aug 17, 2024

  • Refactor world creation to use WorldPreset.
  • Add generator argument to WorldImportCommand.
  • Refactor WorldLoadCommand for improved level loading.
  • Refactor server listener dimension loading.
  • Remove loadLevel methods from PaperLevelView.
  • Add PaperLevel and PaperLevelBuilder classes.
  • Add new world types to properties files.
  • Add levelBuilder method to WorldsProvider interface.
  • Remove overloaded loadLevel methods.
  • Add Level and LevelBuilder interfaces.

Introduced `Level` and `LevelBuilder` interfaces to encapsulate the properties and construction of game levels. This addition provides a structured way to manage level attributes and enables flexible creation and configuration of levels.
Consolidate and simplify the LevelView interface by removing several overloaded loadLevel methods that handle various cases. This streamlines the code and reduces redundancy, making the interface cleaner and easier to maintain.
Introduced a new method, levelBuilder, to the WorldsProvider interface, which takes a File parameter. This addition enhances the functionality of WorldsProvider by allowing the creation of levels through LevelBuilder.
Updated the properties files to include new world types: Checkerboard, Debug, and Single Biome. This change ensures that both the German and English properties files are synchronized with the latest world type definitions.
Introduce the PaperLevel and PaperLevelBuilder classes for advanced world creation and configuration. This update enhances the plugin's flexibility, enabling more detailed control over world settings, including environment, hardcore mode, structures, and custom generator presets.
Eliminated several overloaded loadLevel methods to simplify the code and reduce unnecessary complexity. The core functionality for loading levels has been streamlined, removing unneeded configurations and predicates.
Refactor the dimension loading process in ServerListener.java for clarity and better error handling. Improved logging to include dimension type and its source path, and differentiated between level directories and levels, reducing ambiguity in log messages.
Update the WorldLoadCommand to use levelBuilder for loading, ensuring only imported levels are created. This change enhances readability and robustness by leveraging Optional and streamlining the loading logic.
Extended the WorldImportCommand to support an additional "generator" argument. Adjusted the execute method to handle the new parameter and modified the level creation logic accordingly. Added persistence of the generator configuration when a world is imported.
Replaced deprecated WorldType with WorldPreset for better clarity in defining world types. Updated the creation logic to utilize a new level builder pattern, improving configurability and modularity. This refactor enhances maintainability and aligns with recent API changes.
@NonSwag NonSwag merged commit f06d9c4 into master Aug 17, 2024
2 checks passed
@NonSwag NonSwag deleted the level-builder branch August 17, 2024 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant